package com.autosalon.ui.automobil.state;

import com.autosalon.ui.automobil.Automobil;
import com.autosalon.ui.automobil.state.kategorie.NewKatState_Seller;
import com.autosalon.ui.automobil.state.model.NewModState_Seller;
import com.autosalon.ui.automobil.state.vyrobce.EditVyrState_Customer;
import com.autosalon.ui.automobil.state.vyrobce.EditVyrState_Invitor;
import com.autosalon.ui.automobil.state.vyrobce.EditVyrState_Seller;
import com.autosalon.ui.automobil.state.vyrobce.NewVyrState_Customer;
import com.autosalon.ui.automobil.state.vyrobce.NewVyrState_Seller;
import com.autosalon.ui.automobil.state.vyrobce.ViewVyrState_Customer;
import com.autosalon.ui.automobil.state.vyrobce.ViewVyrState_Invitor;
import com.autosalon.ui.automobil.state.vyrobce.ViewVyrState_Seller;

/** 
 * Trida pro rozhodni podle stavu podle role
 * @author Petr Kriegisch
 */
public class AutomobilStateHolder {

    public static IAutomobilState[] NEW_AUTOMOBIL_STATE = {new NewAutState_Invitor(), new NewAutState_Customer(), new NewAutState_Seller()};
    public static IAutomobilState[] EDIT_AUTOMOBIL_STATE = {new EditAutState_Invitor(), new EditAutState_Customer(), new EditAutState_Seller()};
    public static IAutomobilState[] VIEW_AUTOMOBIL_STATE = {new ViewAutState_Invitor(), new ViewAutState_Customer(), new ViewAutState_Seller()};
    public static IAutomobilState[] NEW_VYROBCE_STATE = {null, new NewVyrState_Customer(), new NewVyrState_Seller()};
    public static IAutomobilState[] EDIT_VYROBCE_STATE = {new EditVyrState_Invitor(), new EditVyrState_Customer(), new EditVyrState_Seller()};
    public static IAutomobilState[] VIEW_VYROBCE_STATE = {new ViewVyrState_Invitor(), new ViewVyrState_Customer(), new ViewVyrState_Seller()};
    public static IAutomobilState[] NEW_MODEL_STATE = {null, null, new NewModState_Seller()};
    public static IAutomobilState[] NEW_KATEGORIE_STATE = {null, null, new NewKatState_Seller()};

    public static void setState(IAutomobilState[] automobilState, int id_role, Automobil automobil) {
        automobilState[id_role - 1].initButtons(automobil);
        automobilState[id_role - 1].initOthersCompoments(automobil);
        automobilState[id_role - 1].initForms(automobil);
        automobilState[id_role - 1].initTabs(automobil);
    }
}
